#include <stdio.h>
#include <string.h>
#define BUFFER_SIZE 16

int main()
{
//char buffer3[BUFFER_SIZE]; //字符数组

    /*清楚脏数据*/

//    memset(buffer, 0, sizeof(buffer));
#if 0
//赋值方式一
buffer[0] = 'h';
buffer[1] = 'e';

#endif

#if 0
/*赋值方式2*/
  strcpy(buffer,"hello world");




#endif
#if 0
      /*赋值方式9*/
      char buffer2[BUFFER_SIZE] = "hello world";
      printf("buffer:%s\n",buffer2);


#endif

#if 0
  /*赋值方式4*/
    
    char buffer3[BUFFER_SIZE] = {'h','e','l','l','o'};


    /*%s:字符串打印  */
    printf("buffer3:%s\n",buffer3);

    return 0;
#endif

  #if 1

    char buffer[] = "257jiayou";
    int  Len = sizeof(buffer);
    int  len = strlen(buffer);
    printf("Len:%d\t,len:%d\n",Len,len);//\t就是一个tab键

    /*任何一个字符串都有一个结束符，以\0结束*/



    /*特殊情况*/
    char buffer3[BUFFER_SIZE] = {'h','e','l','l','o'};
    Len = sizeof("buffer3");
    len = strlen("buffer3");

    printf("Len:%d\t, len:%d,\t buffer3:%s\n", Len, len, buffer3);
    //\t就是一个tab键

    //字符串  只要没有结束符\0 就一直向后面找

  #endif
  return 0;
}